package com.ruoyi.yipaiju.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.yipaiju.domain.Notice;
import com.ruoyi.yipaiju.mapper.NoticeMapper;
import com.ruoyi.yipaiju.service.INoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * fo_noticeService业务层处理
 * 
 * @author liuwp
 * @date 2023-03-01
 */
@Service
public class NoticeServiceImpl implements INoticeService 
{
    @Autowired
    private NoticeMapper noticeMapper;

    /**
     * 查询fo_notice
     * 
     * @param id fo_notice主键
     * @return fo_notice
     */
    @Override
    public Notice selectNoticeById(Long id)
    {
        return noticeMapper.selectNoticeById(id);
    }

    /**
     * 查询fo_notice列表
     * 
     * @param notice fo_notice
     * @return fo_notice
     */
    @Override
    public List<Notice> selectNoticeList(Notice notice)
    {
        return noticeMapper.selectNoticeList(notice);
    }

    /**
     * 根据业务主键查询一条记录：fo_notice
     *
     * @param notice fo_notice
     * @return fo_notice
     */
    @Override
    public Notice selectOneNotice(Notice notice)
    {
        return noticeMapper.selectOneNotice(notice);
    }

    /**
     * 新增fo_notice
     * 
     * @param notice fo_notice
     * @return 结果
     */
    @Override
    public int insertNotice(Notice notice)
    {
        notice.setCreateTime(DateUtils.getNowDate());
        return noticeMapper.insertNotice(notice);
    }

    /**
     * 修改fo_notice
     * 
     * @param notice fo_notice
     * @return 结果
     */
    @Override
    public int updateNotice(Notice notice)
    {
        return noticeMapper.updateNotice(notice);
    }

    @Override
    public int updateNoticeCondition(Notice notice, Notice noticeCondition)
    {
        return noticeMapper.updateNoticeCondition(notice, noticeCondition);
    }

    /**
     * 批量删除fo_notice
     * 
     * @param ids 需要删除的fo_notice主键
     * @return 结果
     */
    @Override
    public int deleteNoticeByIds(Long[] ids)
    {
        return noticeMapper.deleteNoticeByIds(ids);
    }

    /**
     * 删除fo_notice信息
     * 
     * @param id fo_notice主键
     * @return 结果
     */
    @Override
    public int deleteNoticeById(Long id)
    {
        return noticeMapper.deleteNoticeById(id);
    }

    /**
     * 条件删除fo_notice
     *
     * @param notice fo_notice
     * @return 结果
     */
    @Override
    public int deleteNoticeByCondition(Notice notice)
    {
        return noticeMapper.deleteNoticeByCondition(notice);
    }

    @Override
    public List<Notice> selectNoticeHouseInfo(Notice notice) {
        return noticeMapper.selectNoticeHouseInfo(notice);
    }

    @Override
    public List<Notice> selectNoticeListForeclosed(Notice notice) {
        return noticeMapper.selectNoticeListForeclosed(notice);
    }

}
